package com.collection;

import java.util.Properties;

/**
 * Properties 资源配置文件的读写
 * 资源配置文件
 *
 * @author jiangbang
 * @date 2016/5/31
 */
public class Perperties1 {

    public static void main(String[] args) {
        //创建对象
        Properties pro = new Properties();
        //存储
        pro.setProperty("driver","oracle.jdbc.driver.OracleDriver");
//        pro.setProperty("url","jdbc:oracle:thin:@localhost:1521:orcl");
        pro.setProperty("user","root");
        pro.setProperty("pwd","123456");

        //获取
        String url = pro.getProperty("url","test"); //如果没有找到url属性，则显示默认的test
        System.out.println(url);
    }
}
